Namespace Tafi.VisionColor.UI

    Partial Class Forms_FrmDetEvents_List
        Inherits Tafi.Portal.UI.PortalPage

        Protected Sub Page_Load1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not IsPostBack Then
                Consultar()
            End If
        End Sub

        Protected Sub GridV_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridV.RowCreated
            Dim oKey As DataKey
            If e.Row.RowType = DataControlRowType.DataRow Then
                oKey = GridV.DataKeys(e.Row.RowIndex)

                CType(e.Row.Cells(e.Row.Cells.Count - 2).FindControl("ChkInt"), CheckBox).Checked = (Val(oKey("Internal")) <> 0)

                If oKey("CountArchive") > 0 Then
                    CType(e.Row.Cells(e.Row.Cells.Count - 1).FindControl("ChkArc"), CheckBox).Checked = True
                End If

                oKey = Nothing
            End If
        End Sub

        Private Sub Consultar()
            Dim oDS As Data.DataSet
            Dim oTxtRd As IO.StringReader
            Dim Value As String = ""
            Try
                Value = Owner.Framework.WebServiceLoader.WSLoader.ExecuteWebService(Owner.Framework.Configuration.SettingsManager.GetValue("WSDL"), _
                                                                            "Service", "GetEventList", False, "", 0, "", "", "", _
                                                                            CLng(Request.QueryString("TicketId")), CInt(-1))

                oDS = New Data.DataSet
                oTxtRd = New IO.StringReader(Value)

                oDS.ReadXml(oTxtRd)

                If oDS.Tables.Count > 0 Then
                    GridV.DataSource = oDS.Tables(0).DefaultView
                Else
                    GridV.DataSource = Nothing
                End If

                GridV.DataBind()

            Catch ex As Exception
                Throw ex
            Finally
                oTxtRd = Nothing
                oDS = Nothing
            End Try
        End Sub

    End Class

End Namespace
